import Cookies from 'js-cookie'

const TokenKey = 'Access-Token'
const RefreshTokenKey = 'Refresh-Token'
const TimeKey = 'Expire-Time'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token, { expires: 7 })
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getRefreshToken() {
  return Cookies.get(RefreshTokenKey)
}

export function setRefreshToken(refreshToken) {
  return Cookies.set(RefreshTokenKey, refreshToken, { expires: 7 })
}

export function removeRefreshToken() {
  return Cookies.remove(RefreshTokenKey)
}

export function getTokenTime() {
  return Cookies.get(TimeKey)
}

export function setTokenTime(time) {
  return Cookies.set(TimeKey, time, { expires: 7 })
}

export function removeTokenTime() {
  return Cookies.remove(TimeKey)
}
